/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define CODEC_LEDCTRL1_PIN GPIO_PIN_0
#define CODEC_LEDCTRL1_PORT GPIOA
#define CODEC_LEDCTRL2_PIN GPIO_PIN_1
#define CODEC_LEDCTRL2_PORT GPIOA
#define IN_KEY5_PIN GPIO_PIN_2
#define IN_KEY5_PORT GPIOA
#define IN_KEY4_PIN GPIO_PIN_3
#define IN_KEY4_PORT GPIOA
#define IN_KEY3_PIN GPIO_PIN_4
#define IN_KEY3_PORT GPIOA
#define IN_KEY2_PIN GPIO_PIN_5
#define IN_KEY2_PORT GPIOA
#define IN_KEY1_PIN GPIO_PIN_6
#define IN_KEY1_PORT GPIOA
#define LED_CTRL1_PIN GPIO_PIN_0
#define LED_CTRL1_PORT GPIOB
#define LED_CTRL2_PIN GPIO_PIN_1
#define LED_CTRL2_PORT GPIOB
#define LED_CTRL3_PIN GPIO_PIN_2
#define LED_CTRL3_PORT GPIOB
#define LED_CTRL4_PIN GPIO_PIN_10
#define LED_CTRL4_PORT GPIOB
#define LED_CTRL5_PIN GPIO_PIN_11
#define LED_CTRL5_PORT GPIOB
#define LED_CTRL6_PIN GPIO_PIN_7
#define LED_CTRL6_PORT GPIOA
#define ALM_BLUECTRL_PIN GPIO_PIN_13
#define ALM_BLUECTRL_PORT GPIOB
#define ALM_GRNCTRL_PIN GPIO_PIN_14
#define ALM_GRNCTRL_PORT GPIOB
#define ALM_REDCTRL_PIN GPIO_PIN_15
#define ALM_REDCTRL_PORT GPIOB
#define WDI_PIN GPIO_PIN_12
#define WDI_PORT GPIOA
#define RUN_LED_PIN GPIO_PIN_3
#define RUN_LED_PORT GPIOB
#define I2C_SDA_PIN GPIO_PIN_4
#define I2C_SDA_PORT GPIOB
#define I2C_SCL_PIN GPIO_PIN_5
#define I2C_SCL_PORT GPIOB

#define CODEC_PUSH_PIN GPIO_PIN_8
#define CODEC_PUSH_PORT GPIOB

/* USER CODE BEGIN Private defines */
extern unsigned int mTick;
#define EVENT_TICK_10MS			0x01
#define EVENT_TICK_100MS		0x02
#define EVENT_TICK_500MS		0x04

extern unsigned int event_word;
/* USER CODE END Private defines */


#define Is_DebuggerPresent() (CoreDebug->DHCSR & 1) 

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
